import React from 'react';
import { Switch, Route } from 'react-router-dom';
import KeywordSettings from './KeywordSettings';
import OperationLog from '../GeneralManagement/OperationLog';
import ApiPage from '../ApiPage';
import VulTempSettings from './vulTempSettings';
import CreateVulTemp from './vulTempSettings/createTemp';

export default function Weakness() {
	return (
		<Switch>
			<Route
				path="/policy-manage/keyword-settings/:type"
				component={KeywordSettings}
			/>
			<Route
				path="/policy-manage/vul-template-settings/list"
				component={VulTempSettings}
			/>
			<Route
				path="/policy-manage/vul-template-settings/create"
				component={CreateVulTemp}
			/>
			{(JSON.parse(sessionStorage.getItem('resD')).balance?.api && JSON.parse(sessionStorage.getItem('resD')).balance?.api?.time > 0) && <Route path="/policy-manage/api-page" component={ApiPage} />}
			<Route path="/policy-manage/general/operation-log" component={OperationLog} />
		</Switch>
	);
}
